//
//  JQFYTicketPayTableViewCell.m
//  JQFY
//
//  Created by 代辉 on 2017/10/16.
//  Copyright © 2017年 yannis. All rights reserved.
//

#import "JQFYTicketPayTableViewCell.h"


@interface JQFYTicketPayTableViewCell ()

@property (nonatomic,strong) UILabel *name;
@property (nonatomic,strong) UILabel *time;

@end

@implementation JQFYTicketPayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    UIImageView *bgImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_cell_bg"]];
    self.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:bgImage];
    [bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(20 *SCAL);
        make.right.equalTo(self.contentView).offset(-20 *SCAL);
        make.top.equalTo(self.contentView).offset(5 *SCAL);
        make.bottom.equalTo(self.contentView).offset(-5 *SCAL);
    }];
    
    self.selectImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"select_cell"]];
    self.selectImageView.hidden = YES;
    [self.contentView addSubview:self.selectImageView];
    [self.selectImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(bgImage);
    }];
    self.name = [UILabel new];
    [self.contentView addSubview:self.name];
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(bgImage).offset(20 *SCAL);
        make.centerY.equalTo(bgImage);
    }];
    self.name.text = @"票类名称";
    
//    self.time = [UILabel new];
//    [self.contentView addSubview:self.time];
//    [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.name.mas_right).offset(5 *SCAL);
//        make.centerY.equalTo(self.name);
//    }];
//    self.time.font = [UIFont systemFontOfSize:12];
//    self.time.text = @"(2017/10/10 周一 11:30-12:30)";
    
}

- (void)setTicket_info:(JQFYTicketInfo_BuyModel *)ticket_info
{
    _ticket_info = ticket_info;
    self.name.text = ticket_info.explain;
}
- (void)setTitleColor:(UIColor *)titleColor
{
    _titleColor = titleColor;
    self.name.textColor = titleColor;
    self.time.textColor = titleColor;
}
@end
